/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * NuGat-API named Chameleon developed by Simon De Baets to Verimag.
 *
 */


package chameleon.model.NuGatManager.Strategy;

import chameleon.gameSolver.NuGat.NuGatInterface;
import chameleon.model.NuGatStructure.utils.Node;
import chameleon.model.NuGatStructure.utils.NodeList;
import com.sun.jna.Pointer;

/**
 *
 * @author simon
 */
public class PreImageIterator {

    private NodeList preImage_;
    private NuGatInterface nugat_;
    private Pointer listIter_;

    public PreImageIterator(PreImage preImage, NuGatInterface nugat){
        //preImage_ = new NodeList(preImage.getReachStateList().ptr(), nugat);
        nugat_ = nugat;
        listIter_ = preImage_.getFirstIter();
    }

    public boolean hasNext(){
        return preImage_.ListIterIsEnd(listIter_);
    }

    public void next(){
        listIter_ = preImage_.ListIterGetNext(listIter_);
    }

    public Node getElem(){
        return preImage_.getElemAt(listIter_);
    }

    public void printElem(String fileName){
         /*Enc emptyEnc = new Enc(nugat_);
         SymbTable st = new SymbTable(nugat_.Compile_get_global_symb_table(), nugat_);
         BddEnc enc = emptyEnc.getBddEncoding();
         NodeList vars = st.getVars();

         enc.printBddWff(preImage_.getElemAt(listIter_).ptr(),
                 vars.ptr(),false, false, 0, nugat_.CmdOpenFile(fileName));*/
    }

}
